#include <stdint.h>

class IndexArrayMapping {
    
private:
    //buffer
    uint8_t* m_base;

    //the capacity of index array
    uint32_t m_size;

    //the size of m_base
    uint32_t m_buflen;

    //section size, should be pow of 2
    uint32_t m_sectionSize;
    uint32_t m_shift;

public: 
    IndexArrayMapping(uint32_t size, uint32_t sectionSize);
    ~IndexArrayMapping();

    void insert(uint32_t index);
    bool test(uint32_t index);
    uint32_t getSectionSize();
    void merge(const IndexArrayMapping& iam);

private:
    IndexArrayMapping(const IndexArrayMapping&);
    void operator=(const IndexArrayMapping&);
};
